<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://earth.google.com/kml/2.0">

    <!-- Initial version extracted from http://cse-mjmcl.cse.bris.ac.uk/blog/2005/07/23/1122078672484.html -->

   <xsl:output method="xml" omit-xml-declaration="no" indent="yes" />

   <xsl:template match="/">
      <kml xmlns="http://earth.google.com/kml/2.0">
         <Folder>
            <name>GeoURL</name>
            <open>1</open>
            <xsl:apply-templates select="*[local-name()='RDF']" />
         </Folder>
      </kml>
   </xsl:template>

   <xsl:template match="*[local-name()='RDF']">
      <xsl:apply-templates select="*[local-name()='item']" />
   </xsl:template>

   <xsl:template match="*[local-name()='item']">
      <Placemark>
         <description>
            <xsl:element name="a">
               <xsl:attribute name="href">
                  <xsl:value-of select="*[local-name()='link']" />
               </xsl:attribute>
               <xsl:value-of select="*[local-name()='title']" />
            </xsl:element>
         </description>
         <name>
            <xsl:value-of select="*[local-name()='title']" />
         </name>
         <LookAt>
            <longitude>
               <xsl:value-of select="*[local-name()='long']" />
            </longitude>
            <latitude>
               <xsl:value-of select="*[local-name()='lat']" />
            </latitude>
            <range>540.68</range>
            <tilt>0</tilt>
            <heading>3</heading>
         </LookAt>
         <Point>
            <coordinates>
                <xsl:value-of select="*[local-name()='long']" />,<xsl:value-of select="*[local-name()='lat']" />,0
            </coordinates>
         </Point>
      </Placemark>
   </xsl:template>
</xsl:stylesheet>